<template>
  <div class="app-container">
    <el-tabs type="border-card" :value="activeTab" @tab-click="changeTab">
      <el-tab-pane v-if="roleCheck('apply-tab')" name="one">
        <span slot="label"><i class="el-icon-date"></i> 资金调整申请</span>
        <adjustment-apply v-show="activeTab === 'one'" />
      </el-tab-pane>
      <el-tab-pane v-if="roleCheck('audit-tab')" label="资金调整审核" name="two">
        <adjustment-audit v-show="activeTab === 'two'" />
      </el-tab-pane>
    </el-tabs>

  </div>
</template>

<script>
import AdjustmentAudit from '@/views/finance/adjustment/audit';
import AdjustmentApply from '@/views/finance/adjustment/apply';
import { tabs } from '@/build';

export default {
  name: 'finance-adjustment',
  components: {
    AdjustmentApply,
    AdjustmentAudit,
  },
  data() {
    return {
      activeTab: 'two',
    };
  },
  mixins: [tabs],
  mounted() {
    this.$store.dispatch(types.SAVE_OPERATION_LOG, { content: _.getContent(this.$route, '调整申请', true) });
  },
  methods: {
    changeTab(tabs) {
      this.activeTab = tabs.name;
      this.$store.dispatch(types.SAVE_OPERATION_LOG, { content: _.getContent(this.$route, tabs.label, true) });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
